/**
 * Created by Administrator on 2016/12/2 0002.
 */
app.controller("privilege",["$scope",'$location',function($scope,$location){
    $("a").click(function(e){
        e.preventDefault();
    });
    $(".remove").click(function(){
        $(".deletePrivilege").show();
    });
    $scope.deletePrivilege = function(){
        $(".deletePrivilege").hide();
    };
    $scope.cancelDeletePrivilege = function(){
        $(".deletePrivilege").hide();
    };
    $('input').iCheck({
        checkboxClass: 'icheckbox_minimal-green',
        radioClass: 'iradio_minimal-green',
        increaseArea: '20%' // optional
    });
}]);
app.controller("privilegeTable",["$scope",'$location',function($scope,$location){
    $('#privilegeTable').bootstrapTable({
        columns: [
            {
                checkbox: true
            },{
                field: 'name',
                title: '权限名称',
                align:"left",
                halign:"center"
            }, {
                field: 'authorityTableName',
                title: '表名',
                align:"left",
                halign:"center"
            }, {
                field: 'creator',
                title: '创建人',
                align:"left",
                halign:"center"
            }, {
                field: 'createDate',
                title: '创建日期',
                align:"left",
                halign:"center"
            }, {
                field: 'isEnable',
                title: '启用',
                width:50
            }],
        data: [
            {
                name: 'APP用户',
                authorityTableName:'appTable',
                creator:'sysAdmin',
                createDate: '2016-12-29',
                isEnable: '<input type="checkbox" value="">'
            },{
                name: 'APP用户',
                authorityTableName:'appTable',
                creator:'sysAdmin',
                createDate: '2016-12-29',
                isEnable: '<input type="checkbox" value="">'
            },{
                name: 'APP用户',
                authorityTableName:'appTable',
                creator:'sysAdmin',
                createDate: '2016-12-29',
                isEnable: '<input type="checkbox" value="">'
            },{
                name: 'APP用户',
                authorityTableName:'appTable',
                creator:'sysAdmin',
                createDate: '2016-12-29',
                isEnable: '<input type="checkbox" value="">'
            },{
                name: 'APP用户',
                authorityTableName:'appTable',
                creator:'sysAdmin',
                createDate: '2016-12-29',
                isEnable: '<input type="checkbox" value="">'
            },{
                name: 'APP用户',
                authorityTableName:'appTable',
                creator:'sysAdmin',
                createDate: '2016-12-29',
                isEnable: '<input type="checkbox" value="">'
            },{
                name: 'APP用户',
                authorityTableName:'appTable',
                creator:'sysAdmin',
                createDate: '2016-12-29',
                isEnable: '<input type="checkbox" value="">'
            },{
                name: 'APP用户',
                authorityTableName:'appTable',
                creator:'sysAdmin',
                createDate: '2016-12-29',
                isEnable: '<input type="checkbox" value="">'
            },{
                name: 'APP用户',
                authorityTableName:'appTable',
                creator:'sysAdmin',
                createDate: '2016-12-29',
                isEnable: '<input type="checkbox" value="">'
            }
        ],
        pagination :true,
        paginationLoop: false,
        striped :true,
        paginationPreText : "上一页",
        paginationNextText :"下一页",
        undefinedText : "暂无数据",
        showColumns :true,
        showExport : true,
        showRefresh :true,
        height:711,
        showPaginationSwitch:true,
        pageSize:15,
        pageList :[10,15,20]
    });
}]);